package com.zhuss.controller.product;

import com.zhuss.bean.bo.product.preline.DetailPrelineSignBo;
import com.zhuss.bean.bo.product.preline.SearchPrelineBo;
import com.zhuss.bean.bo.product.preline.SearchPrelineSignBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.exception.DzcxException;
import com.zhuss.product.preline.PrelineReadService;
import com.zhuss.product.preline.PrelineSignReadServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * @description: 招募报名查询Controller
 * @author: zhushanshuo
 * @create: Wed Jan 06 16:26:20 CST 2021
 **/
@RestController
@RequestMapping("/prelineSign")
public class PrelineSignReadController extends BaseController {

	@Autowired
	@Qualifier("prelineSignReadService")
	private ReadService<Object, Object> prelineSignReadService;

	@Autowired
	@Qualifier("prelineSignReadServiceExt")
	private PrelineSignReadServiceExt prelineSignReadServiceExt;

	@Autowired
	@Qualifier("prelineReadService")
	private PrelineReadService prelineReadService;
	/**
	 * 详情
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	@ResponseBody
	@RequestMapping("/detail")
    public Object detail(@RequestBody DetailPrelineSignBo bo) throws DzcxException {

		Object result = prelineSignReadService.detail(bo);
		return result;
    }

	/**
	 * 列表
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	@ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchPrelineBo bo) throws DzcxException {
		bo.setStatus(StartStopEnum.启用.key());
		Object result = prelineReadService.prelinelist(bo);
		return result;
    }

	/**
	 * 我的报名
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	@ResponseBody
	@RequestMapping("/mySign")
	public Object mySignList(@RequestBody SearchPrelineSignBo bo) throws DzcxException {
		Object result = prelineSignReadServiceExt.mySignList(bo);
		return result;
	}


}
